/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package isd.resto.dao;

import isd.general.dao.BaseDAO;
import isd.resto.modelo.RT_Mesa;
import isd.resto.modelo.RT_Mozo;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.Query;

/**
 *
 * @author Claudio
 */
@Stateless
public class RT_MozoDAO extends BaseDAO {

    public List<RT_Mozo> getLista(){

        try {
            

            String sQuery = "SELECT m FROM RT_Mozo m ";
                   sQuery += "WHERE m.auditoria.debaja = 'N'";
                   sQuery +=" ORDER BY m.codigo  ";

            Query q = em.createQuery(sQuery);
            return q.getResultList();

        } catch (Exception e) {

            System.err.println("Error al obtener lista de mozos");
            return new ArrayList<RT_Mozo>();
        }

    }
    
    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")
 
}
